<template>
  <div class="synthetic-dialog">
    <el-dialog
      class="syntheticDialog"
      :visible="isSyntheticDialog"
      top="20vh"
      center
      :before-close="closeSyntheticDialog"
      :show-close="false"
      :close-on-click-modal="false"
    >
      <div class="dialog-title">
        <img
          @click="closeSyntheticDialog"
          src="@/assets/images/pc_black/auth/close.png"
        />
      </div>

      <!-- <template v-if="isLoading">
        <div class="dialog-loading">
          <van-loading size="40" color="#00ffb0" />
        </div>
      </template>
      <template v-else>
        <div class="dialog-content">
          <div class="dialog-content-top">恭喜获得</div>
          <div class="dialog-content-title">{{ productData.name }}</div>
          <div class="dialog-content-ewm">
            <img :src="productData.icon" />
          </div>
        </div>
      </template> -->

      <div class="dialog-content">
        <div class="dialog-content-top">恭喜获得</div>
        <div class="dialog-content-title">{{ productData.name }}</div>
        <div class="dialog-content-ewm">
          <img :src="productData.icon" />
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "SyntheticDialog",
  props: {
    isSyntheticDialog: {
      type: Boolean,
      default: false,
    },
    productData: {
      type: Object,
      required: true,
    },
    isLoading: {
      type: Boolean,
      default: true,
    },
  },
  methods: {
    // 关闭弹窗
    closeSyntheticDialog() {
      this.$emit("handleCloseSyntheticDialog");
    },
  },
};
</script>

<style lang="less" scoped>
.synthetic-dialog {
  width: 100%;
  height: 100%;

  // Synthetic dialog
  .syntheticDialog {
    /deep/.el-dialog {
      position: relative;
      width: 500px;
      height: 400px;
      background: #1e2020;
      border-radius: 10px;

      .el-dialog__header {
        display: none;
      }
      .el-dialog__body {
        margin: 0;
        padding: 0;

        .dialog-title {
          display: flex;
          justify-content: flex-end;
          width: 100%;
          padding: 30px 30px 0 0;

          img {
            width: 16px;
            height: 16px;
            cursor: pointer;
          }
        }
        .dialog-content {
          position: relative;
          width: 100%;

          .dialog-content-top {
            font-size: 22px;
            font-family: PingFangSC-Semibold, PingFang SC;
            font-weight: 600;
            color: #ffffff;
            text-align: center;
          }

          .dialog-content-title {
            font-size: 18px;
            font-family: PingFangSC-Semibold, PingFang SC;
            font-weight: 600;
            color: #ffffff;
            line-height: 18px;
            text-align: center;
            margin-top: 30px;
          }

          .dialog-content-ewm {
            display: flex;
            justify-content: center;
            margin-top: 30px;
            font-size: 0;

            img {
              width: 150px;
              height: 150px;
              margin-left: 20px;
            }
            img:first-child {
              margin: 0;
            }
          }
        }

        .dialog-loading {
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -80%);
        }

        // 双击不选中
        -moz-user-select: none;
        -webkit-user-select: none;
        -ms-user-select: none;
        -khtml-user-select: none;
        user-select: none;
      }
    }
  }

  /deep/.el-dialog__wrapper {
    background: rgba(0, 0, 0, 0.8);
  }
}

@media screen and (max-width: 768px) {
  .synthetic-dialog {
    .syntheticDialog {
      /deep/.el-dialog {
        width: 90%;
        height: 650px;

        .el-dialog__body {
          .dialog-title {
            padding: 30px 30px 0 0;

            img {
              width: 32px;
              height: 32px;
            }
          }
          .dialog-content {
            padding-top: 50px;

            .dialog-content-top {
              font-size: 44px;
            }

            .dialog-content-title {
              font-size: 36px;
              line-height: 36px;
              margin-top: 60px;
            }

            .dialog-content-ewm {
              margin-top: 40px;

              img {
                width: 250px;
                height: 250px;
                margin-left: 40px;
              }
            }
          }
        }
      }
    }
  }
}
</style>
